package com.bestcem.xm.txtanls.controller.param.chart;

import com.bestcem.xm.txtanls.grpc.service.param.chart.BaseChartParam;
import com.bestcem.xm.txtanls.grpc.service.param.chart.TopicReferenceTrendParam;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.BeanUtils;

import java.time.LocalDate;

/**
 * 话题提及率变化趋势参数
 * @author jy.zhao
 * @version 2.0
 * @date 2021/7/27 17:59
 **/
@Getter
@Setter
public class TopicReferenceTrendQuery extends BaseChartQuery {

    @ApiModelProperty(value = "话题组id")
    @JsonProperty(value = "topics_group_id")
    private String topicGid;

    @ApiModelProperty(value = "话题id")
    @JsonProperty(value = "topics_id")
    private String topicId;

    public TopicReferenceTrendParam getTopicReferenceTrendParam() {
        BaseChartParam baseChartParam = super.getBaseChartParam();
        TopicReferenceTrendParam topicReferenceTrendParam = new TopicReferenceTrendParam();
        BeanUtils.copyProperties(baseChartParam, topicReferenceTrendParam);
        topicReferenceTrendParam.setTopicId(topicId);
        topicReferenceTrendParam.setTopicGid(topicGid);
        return topicReferenceTrendParam;
    }

    public TopicReferenceTrendQuery(String projectId, String fieldId, String filterType, String current, LocalDate startTime, LocalDate endTime, String topicGid, String topicId) {
        super(projectId, fieldId, filterType, current, startTime, endTime);
        this.topicGid = topicGid;
        this.topicId = topicId;
    }
}
